/**
 * 
 */
package com.game.jumpdino.logic.visual;

import com.game.jumpdino.logic.Playground;

/**
 * @author HugoGu
 *
 */
public class Holder extends VisualBase {
	public VisualBase holdee;
	
	@Override
	public void onHit(VisualBase visual, Playground ground){
		if (visual.getVelocity().y > 0){
			// Play the sound.
			super.onHit(visual, ground);
			// Make sure the panda stand above on the visual.
			visual.putOnTopOf(this);
			// Do the jump.
			super.doJump(visual);
		}
	}
	
	@Override
	public void setVx(float x){
		super.setVx(x);
		if (holdee != null){
			holdee.setVx(x);
		}
	}
}
